<?php

namespace App\Recharge\Bean;

use App\Basic\Bean;

class CyclePunchChildBean extends Bean
{
    /**
     * @var array
     */
    public array $child;

    /**
     * @var bool
     */
    public bool $result = false;

    /**
     * @var bool
     */
    public bool $apiSend = false;

    /**
     * @var RequestResultBean|null
     */
    public RequestResultBean|null $response = null;

    /**
     * @var string
     */
    public string $errMessage = "";

    /**
     * @var bool
     */
    public bool $peak_failure = false;


    /**
     * @return array
     */
    public function getChild(): array
    {
        return $this->child;
    }

    /**
     * @param array $child
     */
    public function setChild(array $child): void
    {
        $this->child = $child;
    }

    /**
     * @return bool
     */
    public function isResult(): bool
    {
        return $this->result;
    }

    /**
     * @param bool $result
     */
    public function setResult(bool $result): void
    {
        $this->result = $result;
    }

    /**
     * @return bool
     */
    public function isApiSend(): bool
    {
        return $this->apiSend;
    }

    /**
     * @param bool $apiSend
     */
    public function setApiSend(bool $apiSend): void
    {
        $this->apiSend = $apiSend;
    }

    /**
     * @return RequestResultBean|null
     */
    public function getResponse(): ?RequestResultBean
    {
        return $this->response;
    }

    /**
     * @param RequestResultBean|null $response
     */
    public function setResponse(?RequestResultBean $response): void
    {
        $this->response = $response;
        $this->setApiSend(true);
    }

    /**
     * @return string
     */
    public function getErrMessage(): string
    {
        return $this->errMessage;
    }

    /**
     * @param string $errMessage
     */
    public function setErrMessage(string $errMessage): void
    {
        $this->errMessage = $errMessage;
    }

    /**
     * @return bool
     */
    public function isPeakFailure(): bool
    {
        return $this->peak_failure;
    }

    /**
     * @param bool $peak_failure
     */
    public function setPeakFailure(bool $peak_failure): void
    {
        $this->peak_failure = $peak_failure;
    }
}
